package com.atguigu.tingshu.order.api;

import com.atguigu.tingshu.common.login.GuiGuLogin;
import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.order.service.OrderInfoService;
import com.atguigu.tingshu.vo.order.OrderInfoVo;
import com.atguigu.tingshu.vo.order.TradeVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "订单管理")
@RestController
@RequestMapping("api/order")
@SuppressWarnings({"all"})
public class OrderInfoApiController {

	@Autowired
	private OrderInfoService orderInfoService;

	/**
	 * 订单页确认数据参数汇总
	 * @param tradeVo {itemType:"项目类型",:itemId:"项目",trackCount:"声音数量"}
	 * @return 订单vo对象->为后续提交订单准备
	 */
	@Operation(summary = "订单页确认数据参数汇总")
	@PostMapping("/orderInfo/trade")
	@GuiGuLogin
	public Result<OrderInfoVo> getOrderInfoData(@RequestBody TradeVo tradeVo){
		OrderInfoVo orderInfoVo = orderInfoService.getOrderInfoData(tradeVo);
		return Result.ok(orderInfoVo);
	}

}

